# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: NicoHood <archlinux {cat} nicohood {dog} de>
# Contributor: Sven Klomp <mail@klomp.eu>

pkgname=python-gnupg
pkgdesc="A wrapper for the Gnu Privacy Guard (GPG or GnuPG)"
pkgver=0.5.0
pkgrel=2
arch=(any)
url="https://docs.red-dove.com/python-gnupg/"
license=(BSD)
depends=(gnupg python)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz{,.asc})
sha512sums=('cfd302257b53fdc9318004db7323ea5bf4bddc055b65b24386a1ecb27cd476fdf1bc771adcdde70a4eef442982a0c57dc832b92274bbe5ba16cbdf3247f4e77a'
            'SKIP')
b2sums=('0ae7e8ff669f51b47410a7a5aef16ca6792db18f28c59d3ce6615d0852eba1e201e3d000d1f644ffc1a362a74ee56c0930dd5814c23238137d6d8696319fd130'
        'SKIP')
validpgpkeys=('CA749061914EAC138E66EADB9147B477339A9B86') # Vinay Sajip (CODE SIGNING KEY) <vinay_sajip@yahoo.co.uk>

build() {
  cd $pkgname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $pkgname-$pkgver
  export NO_EXTERNAL_TESTS='true'
  pytest -vv
}

package() {
  cd $pkgname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
